package com.cqupt.scanning.system.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cqupt.scanning.system.admin.entity.PatientFoot;
import com.cqupt.scanning.system.admin.entity.PatientThree;
import com.cqupt.scanning.system.admin.service.PatientThreeService;
import com.cqupt.scanning.system.utils.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 病人用户（前端展示） 前端控制器
 * </p>
 *
 * @author 宋宝梁
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/admin/organization/patientthree")
public class PatientThreeController {

    private PatientThreeService patientThreeService;

    @Autowired
    public PatientThreeController(PatientThreeService patientThreeService) {
        this.patientThreeService = patientThreeService;
    }

    @GetMapping("/getAll")
    @PreAuthorize("hasAuthority('3Dscanning.getAll')")
    public R getAll(
                    @RequestParam(value = "username",required = false) String userName,
                    @RequestParam(value = "name",required = false) String name,
                    @RequestParam(value = "sex",required = false) String sex,
                    @RequestParam(value = "devNum",required = false) String devNum,
                    @RequestParam(value = "business_name",required = false) String businessName,
                    @RequestParam(value = "address",required = false) String address,
                    @RequestParam(value = "city_province",required = false) String cityProvince,
                    @RequestParam(value = "country",required = false) String country,
                    @RequestParam(value = "phone",required = false) String phone,
                    @RequestParam(value = "fax",required = false) String fax,
                    @RequestParam(value = "age",required = false) String age,
                    @RequestParam(value = "age_lower",required = false) String ageLower,
                    @RequestParam(value = "age_upper",required = false) String ageUpper,
                    @RequestParam(value = "height_lower",required = false) String heightLower,
                    @RequestParam(value = "height_upper",required = false) String heightUpper,
                    @RequestParam(value = "weight_lower",required = false) String weightLower,
                    @RequestParam(value = "weight_upper",required = false) String weightUpper,
                    @RequestParam(value = "weight_bearing_lower",required = false) String weightBearingLower,
                    @RequestParam(value = "weight_bearing_upper",required = false) String weightBearingUpper,
                    @RequestParam(value = "dress_shoe",required = false) String dressShoe,
                    @RequestParam(value = "athletic_shoe",required = false) String athleticShoe,
                    @RequestParam(value = "casual_shoe",required = false) String casualShoe,
                    @RequestParam(value = "heels",required = false) String heels,
                    @RequestParam(value = "beginTime",required = false) String beginTime,
                    @RequestParam(value = "endTime",required = false) String endTime,
                    @RequestParam(value = "pageNum", defaultValue = "1") Integer current,
                    @RequestParam(value = "pageSize", defaultValue = "10") Integer size,

                    @RequestParam(value = "orgName",required = false) String orgName,
                    @RequestParam(value = "doctor",required = false) String doctor,
                    @RequestParam(value = "measureMode",required = false) String measureMode
                    ) {
        Page<PatientThree> page = new Page<>(current, size);
        return patientThreeService.getAll(page,  name, ageLower, ageUpper, doctor, heightLower, heightUpper, measureMode, sex, weightLower, weightUpper, beginTime, endTime,userName,phone,orgName,devNum,businessName,address,cityProvince,country,fax,
                weightBearingLower, weightBearingUpper,dressShoe,athleticShoe,casualShoe,heels,age);
    }
}

